/*
    Copyright 2012 Sven-Ove Bjerkan

    This file is part of KO-Ozi.

    KO-Ozi is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    KO-Ozi is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with KO-Ozi. If not, see <http://www.gnu.org/licenses/>.
*/
package com.koozi.auto;

import com.koozi.Settings;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.TimeZone;

/**
 * An abstract class for the autosave and autoload functionality
 * @author Sven-Ove Bjerkan
 */
public abstract class OziAuto {
    public Settings settings;
    public String folderpath;
        
    public javax.swing.JLabel lblLastupdate = null;
    public DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
    public Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT+1"));
    
    public OziAuto(javax.swing.JLabel lblLastupdate) {
            settings = Settings.getInstance();
            folderpath = settings.getProjectPath() + "/";
            
            this.lblLastupdate = lblLastupdate;
    }
    
    public boolean createProjectfolder() {
        File f = new File(folderpath);
        // Check if directory exists, create otherwise
        if (f.isDirectory() || f.mkdir())
            return true;
        else 
            return false;
    }
}

